
import request from '@/utils/request'

/**
 * 策略数据列表
 */
export const getPolicyListAPI = (params) => {
  return request.get('/vm-service/policy/search', { params })
}
/**
 * 新增策略
 */
export const addNewPoliceAPI = (data) => {
  return request.post('/vm-service/policy', data)
}
/**
 * 删除策略
 */
export const deletePoliceAPI = (id) => {
  return request.delete(`/vm-service/policy/${id}`)
}
/**
 * 修改策略
 */
export const editPoliceAPI = (data) => {
  return request.put(`/vm-service/policy/${data.policyId}`, data)
}
/**
 * id获取策略详情
 */
export const policyDetailAPI = (id) => {
  return request.get(`/vm-service/policy/${id}`)
}

/**
 * 根据策略搜索售货机
 */
export const vmListPolicyAPI = (id, params) => {
  return request.get(`/vm-service/policy/vmList/${id}`, { params })
}
/**
 * 策略搜索
 */
export const searchPoliceAPI = (searchName) => {
  return request({ url: '/vm-service/policy/search', params: { pageIndex: 1, pageSize: 10, policyName: searchName }})
}
